This code still uses a snooze_until loop but the latency is adjusted on the fly.  This should let is play probably on a a wide range of computer speeds while keeping overhead down.